//
//  JYTRootViewController.m
//  JYT_IOS
//
//  Created by nxa-tankeke on 16/12/14.
//  Copyright © 2016年 nxa-yuanguoxiang. All rights reserved.
//

#import "JYTRootViewController.h"
#import "JYTTabBarView.h"

@interface JYTRootViewController ()<ProtocolTabBarView>
{
    UINavigationController *selectedViewController;
    NSArray *viewControllers;
    NSInteger selectedIndex;
}
@end

@implementation JYTRootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view setBackgroundColor:[UIColor whiteColor]];
    
    NSLog(@"%f",self.view.frame.size.width);
    
    [self.tabBar setHidden:YES];
    
    JYTTabBarView *tabBar = [[JYTTabBarView alloc] init];
    [self.view addSubview: tabBar];
    
    UIEdgeInsets tpadding = UIEdgeInsetsMake(CURRENT_SCREEN_HEIGHT - TAB_BAR_HEIGHT, 0, 0, 0);
    
    [tabBar mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view).with.insets(tpadding);
    }];
    [tabBar setBackgroundColor:[UIColor clearColor]];
    tabBar.delegate = self;
    self.tabBarView = tabBar;
}


- (void)clickTabBarItemView:(NSInteger)index
{
    MyLog(@"selectedIndexd = %ld", index);
    
    self.selectedIndex = index;
    viewControllers = self.viewControllers;
    self.selectedViewController = viewControllers[index];
    
}

-(BOOL)shouldAutorotate{
    return false;
}
//当前viewcontroller支持哪些转屏方向
- (UIInterfaceOrientationMask)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskPortrait;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
